#!/usr/bin/env python3
# coding=utf-8
# 作者：hnpyzzd
# 时间：2020-03-22
# 用途：随机生成优惠券

import random

yhq_str = ''
yhq_set = set( )

while len(yhq_set) != 200:
    yhq =   random.choice('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') + \
            str(random.randint(0,9)) + \
            random.choice('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') + \
            str(random.randint(0,9)) + \
            random.choice('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') + \
            random.choice('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
    yhq_set.add(yhq)
print('优惠券',yhq_set)
print('优惠券数量',len(yhq_set))

